public class Solution {
    public boolean isNumber(String s) {

        for(int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == 'e') {
                continue;
            }
            if(Character.isLetter(s.charAt(i))) {
                return false;
            }
        }

        try {
            Double.valueOf(s);
            return true;
        } catch(NumberFormatException e) {
            return false;
        }
    }
}